<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of QpcrForm
 *
 * @author Eder Jose Pariona y Espiñal
 */
class Qpcr_Form_UploadForm extends Zend_Form
{
    public function init(){

        $e = new Zend_Form_Element_File('fileupload');
        $e->setLabel('file QPCR');
        $e->setRequired();
        $e->setDestination($_SESSION['ruta_guardar']);
        //validar que solo sea 1 archivo
        $e->addValidator('Count',false,1);
        //valida el tamaño maximo
        $e->addValidator('Size',false,1048576);
        //unicamente zip
        $e->addValidator('Extension',false,'zip');
        $this->addElement($e,'fileupload');
        $this->setAttrib('enctype','multipart/form-data');

        //boton submit:
        $e = new Zend_Form_Element_Submit('submit');
        $e->setLabel('Upload');
        $this->addElement($e);

         $this ->setMethod('post')
               ->setAttrib('id','frmQpcr');
        $this->setAction('/qpcr/index/upload');

    }





//        public function __construct($option = null) {
//        parent::__construct($option);
//
//        $this->setName('login');
//
//        $username = new Zend_Form_Element_Text('username');
//        $username->setLabel('User name:')
//                 ->setRequired();
//
//        $password = new Zend_Form_Element_Password('password');
//        $password->setLabel('Password:')
//                 ->setRequired(true);
//
//        $login = new Zend_Form_Element_Submit('login');
//        $login->setLabel('Login');
//
//        $this->addElements(array($username, $password, $login));
//        $this->setMethod('post');
//        $this->setAction('/qpcr/index/upload');
//    }






















}
?>
